<?php
/**
 * 
 * @author Hieunm
 *
 */
class Model_Restrict extends Model_AbstractModel{
	private $ipRestrict;
	private $typeRestrict;
	private $reasonRestrict;
	private $currentCount;
	private $maxCount;
	private $startRestrictDate;
	private $endRestrictDate;
	
	public function __construct($data) {
		parent::__construct($data);
		if (is_array ( $data )) {
			
			if (isset ( $data ['ip_restrict'] )) {
				$this->ipRestrict = $data ['ip_restrict'];
			}
			
			if (isset ( $data ['type_restrict'] )) {
				$this->typeRestrict = $data ['type_restrict'];
			}
			
			if (isset ( $data ['reason_restrict'] )) {
				$this->reasonRestrict = $data ['reason_restrict'];
			}
			
			if (isset ( $data ['current_count'] )) {
				$this->currentCount = $data ['current_count'];
			}
			
			if (isset ( $data ['max_count'] )) {
				$this->maxCount = $data ['max_count'];
			}
			
			if (isset ( $data ['start_restrict_date'] )) {
				$this->startRestrictDate = $data ['start_restrict_date'];
			}
			
			if (isset ( $data ['end_restrict_date'] )) {
				$this->endRestrictDate = $data ['end_restrict_date'];
			}
			
		}
	}
	
	/**
	 * (non-PHPdoc)
	 * @see Model_AbstractModel::toArray()
	 */
	public function toArray() {
		$arr = parent::toArray();
		$arr['ip_restrict']			= $this->ipRestrict;
		$arr['type_restrict']	    = $this->typeRestrict;
		$arr['reason_restrict']     = $this->reasonRestrict;
		$arr['current_count']       = $this->currentCount;
		$arr['max_count']           = $this->maxCount;
		$arr['start_restrict_date']	= $this->startRestrictDate;
		$arr['end_restrict_date']	= $this->endRestrictDate;
	
		return $arr;
	}

	
	public function getIpRestrict() {
		return $this->ipRestrict;
	}
	
	public function getTypeRestrict() {
		return $this->typeRestrict;
	}
	
	public function getReasonRestrict() {
		return $this->reasonRestrict;
	}
	
	public function getCurrentCount() {
		return $this->currentCount;
	}
	
	public function getMaxCount() {
		return $this->maxCount;
	}
	
	public function getStartRestrictDate() {
		return $this->startRestrictDate;
	}
	
	public function getEndRestrictDate() {
		return $this->endRestrictDate;
	}
	
	public function setIpRestrict($x) {
		$this->ipRestrict = $x;
	}	
	
	public function setTypeRestrict($x) {
		$this->typeRestrict = $x;
	}
	
	public function setReasonRestrict($x) {
		$this->reasonRestrict = $x;
	}
	
	public function setCurrentCount($x) {
		$this->currentCount = $x;
	}
	
	public function setMaxCount($x) {
		$this->maxCount = $x;
	}
	
	public function setStartRestrictDate($x) {
		$this->startRestrictDate = $x;
	}
	
	public function setEndRestrictDate($x) {
		$this->endRestrictDate = $x;
	}
	
}